<div class="main card">
  <form class="form-inline">
    <div class="input-group input-group-sm mb-3">
      <div class="input-group-prepend">
        <span class="input-group-text" id="inputGroup-sizing-sm">work name</span>
      </div>
      <input type="text" [(ngModel)]="search.workName" [ngModelOptions]="{standalone: true}"
             class="form-control" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-sm">
      <div class="input-group-append">
        <button class="btn btn-outline-warning" type="button" (click)="search_work()">search work</button>
      </div>
    </div>
  </form>
  <div class="add_button">
    <button class="btn btn-info btn-sm" type="button" (click)="showWorkModel(1, workModel, workForm)">new Homework
    </button>
  </div>
  <table class="table table-striped">
    <thead>
    <tr>
      <th scope="col">序号</th>
      <th scope="col">课程名称</th>
      <th scope="col">作业名称</th>
      <th scope="col">作业内容</th>
      <th scope="col">期限</th>
      <th scope="col">作业状态</th>
      <th scope="col">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let work of workList; let index = index">
      <th scope="row">{{index +1 }}</th>
      <td>{{work.course_name}}</td>
      <td>{{work.work_name}}</td>
      <td>{{work.centent || '--'}}</td>
      <td>{{work.deadline || '--'}}</td>
      <td>{{work.status == 1 ? '已完成' : '未完成'}}</td>
      <td>
        <button class="btn btn-sm btn-outline-primary" (click)="showWorkModel(2, workModel, work)">Edit</button>
        <button class="btn btn-sm btn-outline-danger" (click)="delWork(work)">Doen</button>
      </td>
    </tr>
    </tbody>
  </table>
  <ng-template #workModel let-modal style="width:1000px">
    <app-work-modal [workForm]="workForm" [modal]="modal" [workType]="workType"
                    (initData)="initData()"></app-work-modal>
  </ng-template>

</div>
